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

Question about parsing varying length data


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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
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
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

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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to save SYSLOG as text data via P... All Other Mainframe Topics 4
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Store the data for fixed length COBOL Programming 1
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
Search our Forums:

Back to Top