Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Question about parsing varying length data

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
manuwankenobi

New User


Joined: 02 Mar 2006
Posts: 32
Location: FRANCE

PostPosted: Wed Feb 04, 2009 3:24 pm    Post subject: Question about parsing varying length data
Reply with quote

Hi all,

My input file is a list of GDS from IDCAMS listcat
(two first lines only for column positioning)
Code:

         1         2         3         4         5
123456789012345678901234567890123456789012345678901
       NONVSAM--PRF.DSE0105.SQL.SYSPRINT.G1712V00               
       NONVSAM--PRF.DSE0105.SQL.SYSPRINT.G1713V00               
       NONVSAM--PRF.DSE0105.SQL.SYSPRINT.G1714V00               
       NONVSAM--PRF.DSE0105.SQL.SYSPRINT.G1715V00               
       NONVSAM--PRF.DSE0105.SQL.SYSPRINT.G1716V00               


I have to get the GDG base name and to sum the number of GDS belonging to the base giving the output record below
GDS position 1 to 44, sum of GDS in position 49 length 3,ZD
(two first lines only for column positioning)

Code:

         1         2         3         4         5
123456789012345678901234567890123456789012345678901
PRF.DSE0105.SQL.SYSPRINT                        005


I tried this :
Code:

//TOOLIN  DD *                                                 
 COPY FROM(IN1) TO(TMP2) USING(CTL4)                           
  INCLUDE COND=(1,14,CH,EQ,C'       NONVSAM')                       
  INREC PARSE=(%00=(STARTAFT=C'NONVSAM--',ENDBEFR=C'.G',FIXLEN=44)),
  BUILD=(%00,49:C'001')                                             
  SORT FIELDS=(1,44,CH,A)                                           
  SUM FIELDS=(49,3,ZD)                                               
  OUTFIL FNAMES=TMP2,OUTREC=(1,44,C'    ',49,3)                     

I works fine, but if the string '.G' is found anywhere in the filename before the GDS number it won't work !

So the question is : is there a way to parse only the gdg base (the length of gdg base is varying) ?


Thanks for all.
Back to top
View user's profile Send private message

manuwankenobi

New User


Joined: 02 Mar 2006
Posts: 32
Location: FRANCE

PostPosted: Wed Feb 04, 2009 3:27 pm    Post subject: Reply to: Question about parsing varying length data
Reply with quote

Sorry,

A card (//CTL4CNTL DD *) is missing in my code :
Code:

//TOOLIN  DD *                                                 
 COPY FROM(IN1) TO(TMP2) USING(CTL4)
//CTL4CNTL DD *                           
  INCLUDE COND=(1,14,CH,EQ,C'       NONVSAM')                       
  INREC PARSE=(%00=(STARTAFT=C'NONVSAM--',ENDBEFR=C'.G',FIXLEN=44)),
  BUILD=(%00,49:C'001')                                             
  SORT FIELDS=(1,44,CH,A)                                           
  SUM FIELDS=(49,3,ZD)                                               
  OUTFIL FNAMES=TMP2,OUTREC=(1,44,C'    ',49,3)   
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed Feb 04, 2009 9:46 pm    Post subject: Reply to: Question about parsing varying length data
Reply with quote

manuwankenobi,

If your intention is to find the GDG base limits check the smart DFSORT trick " Report on GDG base limits" here

http://www.ibm.com/systems/support/storage/software/sort/mvs/tricks/
Back to top
View user's profile Send private message
manuwankenobi

New User


Joined: 02 Mar 2006
Posts: 32
Location: FRANCE

PostPosted: Thu Feb 05, 2009 8:23 am    Post subject:
Reply with quote

Kolusu,

Thank you for the answer.
I always check the document with dfsort's tricks and the application programming guide before asking a question here, the trick you are speaking about is not the one that I need.

I do not want to find the GDG base limit, I want to find the number of GDS currently used (it can be less than the limit).

Maybe there is a way to get all the GDS name into %00 (INREC PARSE=(%00=(STARTAFT=C'NONVSAM--',ENDBEFR=C' ',FIXLEN=44)) ) and remove 8 characters from right to left beginning at the last nonblank character ???

Regards
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri Feb 06, 2009 12:51 am    Post subject:
Reply with quote

manuwankenobi,

The following DFSORT JCL will give you the desired results

Code:

//STEP0100 EXEC PGM=IKJEFT01                             
//SYSTSPRT DD DSN=&L,                                   
//            DISP=(,PASS),                             
//            SPACE=(CYL,(1,1),RLSE),                   
//            DCB=(LRECL=80,RECFM=FB,BLKSIZE=0)         
//SYSTSIN  DD *                                         
  LISTCAT ENT('YOUR GDG BASE NAME') NAME                   
//*                                                     
//STEP0200 EXEC  PGM=ICEMAN                             
//SYSOUT   DD SYSOUT=*                                   
//SORTIN   DD DSN=&L,DISP=(OLD,DELETE)                   
//SORTOUT  DD SYSOUT=*                                   
//SYSIN    DD *                                         
  OPTION COPY                                           
  INCLUDE COND=(1,8,CH,EQ,C'GDG BASE',OR,               
                4,7,CH,EQ,C'NONVSAM')                   
                                                         
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,8,CH,EQ,C'GDG BASE'),
  PUSH=(81:17,44))                                       
  OUTFIL REMOVECC,NODETAIL,BUILD=(80X),                               
  SECTIONS=(81,44,                                       
  TRAILER3=(81,44,3X,COUNT-1=(M11,LENGTH=3)))           
/*
Back to top
View user's profile Send private message
manuwankenobi

New User


Joined: 02 Mar 2006
Posts: 32
Location: FRANCE

PostPosted: Fri Feb 06, 2009 8:40 am    Post subject:
Reply with quote

Thank you very much,

I do not have the PTF needed to try yor code (I will have it in a few weeks !!!).

Waiting for the PTF I'll do the job with REXX...

Best regards.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Paasing symbolic parameter to instrea... Anirudh Anand JCL & VSAM 1 Thu Jul 27, 2017 1:22 pm
No new posts Passing data from REXX to C programme... chong.zhou CLIST & REXX 3 Wed Jul 26, 2017 9:11 pm
No new posts copying data without knowing location arunsoods DFSORT/ICETOOL 11 Thu Jul 20, 2017 1:03 pm
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 19 Thu Jul 13, 2017 2:11 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us