IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to dynamically assign the array variable to store data?


IBM Mainframe Forums -> HomeWorks & Requests
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
jackzhang75

Active User


Joined: 09 Jun 2014
Posts: 125
Location: US

PostPosted: Wed Sep 10, 2014 2:02 am
Reply with quote

Hi ,

I have the input like :
Code:
INP01A  01
 OUT01A 01
 OUT01B 01
 OUT01C 01
 OUT01D 01
 OUT01E  01
 INP02A  02
 OUT02A 02
 INP03A  03
 OUT03A 03
 OUT03B 03
 OUT03C 03
and so on....

I wrote the code to extract or store first colum data according to same number in second colum. The problem is the input file will have number of input each time ,eg this time 03 , maybe next time 04... So is there any way to dynamically assign the different variable to store these data according to same number in second colum instead of write lot of select ...

Thanks for your help!

Code:
DO CU=1 TO Q                               
   DROP STEPNAME                           
   PARSE VALUE STEP.CU WITH STEPNAME TYPE                           
     SELECT                               
         WHEN TYPE="01"  THEN         
              NAME1.CU = STEPNAME                       
         WHEN TYPE="02"  THEN           
              NAME2.CU = STEPNAME                         
         WHEN TYPE="03"  THEN           
              NAME3.CU = STEPNAME                   
         OTHERWISE                         
     END                                   
  END                                     
                       
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Fri Oct 03, 2014 3:46 am
Reply with quote

Please highly avoid same post placing into different sections.
ibmmainframes.com/viewtopic.php?p=325562&highlight=#325562
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> HomeWorks & Requests

 


Similar Topics
Topic Forum Replies
No new posts How to save SYSLOG as text data via P... All Other Mainframe Topics 1
No new posts Store the data for fixed length COBOL Programming 1
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts SCOPE PENDING option -check data DB2 2
Search our Forums:

Back to Top