Can anyone provide me with a example of reading a data area in /Free function?
Thnx
Thnx
CRTDTAARA DTAARA(QTEMP/JUNK) TYPE(*CHAR) LEN(10) VALUE('0123456789') TEXT('some junk')
*
* Variable Definition
*
d whathurts DS DTAARA(JUNK)
d allofme 10
d dsdata ds qualified inz
d WholeTomato 10
d zero 1 overlay(WholeTomato:1)
d one 1 overlay(WholeTomato:*next)
d two 1 overlay(WholeTomato:*next)
d three 1 overlay(WholeTomato:*next)
d four 1 overlay(WholeTomato:*next)
d five 1 overlay(WholeTomato:*next)
d six 1 overlay(WholeTomato:*next)
d seven 1 overlay(WholeTomato:*next)
d eight 1 overlay(WholeTomato:*next)
d nine 1 overlay(WholeTomato:*next)
/Free
//----------------------------------------------------
// MAIN PROGRAM
//----------------------------------------------------
in whathurts;
dsdata.wholetomato = allofme;
*inlr = *on;
/End-Free
CRTDTAARA DTAARA(QTEMP/JUNK) TYPE(*CHAR) LEN(10) VALUE('0123456789') TEXT('some junk')
*
* Variable Definition
*
d whathurts UDS DTAARA(JUNK)
d allofme 10
d dsdata ds qualified inz
d WholeTomato 10
d zero 1 overlay(WholeTomato:1)
d one 1 overlay(WholeTomato:*next)
d two 1 overlay(WholeTomato:*next)
d three 1 overlay(WholeTomato:*next)
d four 1 overlay(WholeTomato:*next)
d five 1 overlay(WholeTomato:*next)
d six 1 overlay(WholeTomato:*next)
d seven 1 overlay(WholeTomato:*next)
d eight 1 overlay(WholeTomato:*next)
d nine 1 overlay(WholeTomato:*next)
/Free
//----------------------------------------------------
// MAIN PROGRAM
//----------------------------------------------------
//** IN is now carried out implicitly **//
//*** in whathurts;
dsdata.wholetomato = allofme;
*inlr = *on;
/End-Free
D Status uds D Stat 1 8 /free Stat = 'BR-549';
d Mydataarea e ds extname(ARMARCH)
*===================================================== *-------------------------------------------------------- * * Variable Definition * d CmdLength s 15 5 inz(0) d CmdString s 256 inz(*blanks) d program21 s 21 inz(*blanks) d reply s 1 // // external calls // d $command pr extpgm('QCMDEXC') d command 5000 options(*varsize) d Length 15 5 /Free //-------------------------------------------------------- // MAIN PROGRAM //-------------------------------------------------------- cmdstring = 'CRTDTAARA DTAARA(QTEMP/MYTWENTY1) TYPE(*CHAR)'; cmdlength = %len(%trim(cmdstring)); monitor; $command (cmdstring:cmdlength); on-error; endmon; // populate it .... *in99 = *on; dow *in99 = *on; in(e) *lock Program21; *in99 = %error; enddo; Program21 = 'Holy Crap Batman!'; out Program21; in Program21; dsply program21 reply; // now clear it .... *in99 = *on; dow *in99 = *on; in(e) *lock Program21; *in99 = %error; enddo; clear Program21; out program21; in Program21; dsply program21 reply ; *inlr = *on; //-------------------------------------------------------- // *inzsr - initial one time subroutine //-------------------------------------------------------- begsr *inzsr; /end-free c *dtaara define MyTwenty1 Program21 /Free endsr; //-------------------------------------------------------- /End-Free
*
*Array
D SEQUENCE S 4 0 DIM(5) ASCEND INZ(*HIVAL)
D
D FILEARRAY DS
D SEQNCE 4S 0 OVERLAY(FILEARRAY:1)
* Program runs and fills dtaara with some stuff, then I call a routine to display
* a screen, and upon a cancel of that screen I clear the dtaara.
C
*
* Was F12 pressed
C IF RETURN
C CLEAR SEQUENCE
C ENDIF
Comment