Showing in reverse order



IBM's Command List programming language & Restructured Extended Executor

Showing in reverse order

Postby arcnazareno » Wed Jul 20, 2016 2:28 pm

Hi,

Need assistance for the rexx code as I am new to this program.

Below is the code that I have been practicing to create a PDS and put some test data on it.

/* REXX */                                            
 PARSE VALUE DATE('S') WITH CC +2 YY +2 MM +2 DD        
                                                       
 WSDATE = MM||DD||YY                                    
                                                       
     DSNAME = 'XXXX.'||USERID()||'.TEST.D'||WSDATE    
     PDSOUT = DSNAME                                    
     DSE = SYSDSN("'"STRIP(DSNAME)"'")                  
     IF DSE <> 'OK' THEN DO                            
       "ALLOC FI(PDSOUT) DA('"DSNAME"') NEW            
         TRACKS SPACE(10 10) DIR(44)                    
         RECFM(F B) LRECL(80)"
                         
     END                                                
                                                       
     "ALLOC FI(PDSOUT) DA('"DSNAME"(ABCDEF)') SHR"      
     "EXECIO 1 DISKW PDSOUT (FINIS"                
     
     DO X=1 TO 5                                        
        PUSH 'TESTING'|| X                              
     END                                                

     "ALLOC DA('"DSNAME"(ABCDEF)') F(OUTDD) SHR REUSE"  
     "EXECIO 5 DISKW OUTDD (FINIS"                      
     "FREE  FI(PDSOUT)"                                
     "ISPEXEC EDIT DATASET('"DSNAME"(ABCDEF)')"        

 

After executing the program, below is the data written in the PDS.
TESTING5
TESTING4
TESTING3
TESTING4
TESTING1


if I try using display 'SAY' it is showing in proper order where it start from TESTING1 but using PUSH and write into the PDS became reverse as the above. is there a way for me to write in PDS in proper order?
In future use the code tags for all data/code. Done for you this time.
arcnazareno
 
Posts: 4
Joined: Wed Jul 20, 2016 2:11 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Showing in reverse order

 

Re: Showing in reverse order

Postby prino » Wed Jul 20, 2016 2:34 pm

Don't use PUSH, use QUEUE
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy

These users thanked the author prino for the post:
arcnazareno (Wed Jul 20, 2016 3:25 pm)
User avatar
prino
 
Posts: 529
Joined: Wed Mar 11, 2009 12:22 am
Location: Oostende, Belgium
Has thanked: 3 times
Been thanked: 20 times

Re: Showing in reverse order

Postby arcnazareno » Wed Jul 20, 2016 3:26 pm

Thank you for the quick reply Prino. I tried the QUEUE syntax and is working now. Thank you very much for help
arcnazareno
 
Posts: 4
Joined: Wed Jul 20, 2016 2:11 pm
Has thanked: 1 time
Been thanked: 0 time


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post