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

How to find copybook info. with the help of DFSORT using IF


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Satish K Kumar

New User


Joined: 06 Oct 2008
Posts: 1
Location: Chennai

PostPosted: Mon Oct 06, 2008 10:39 am
Reply with quote

How i can extract the level information from copybook with the help of DFSORT.

The following levels are written in line number:

01 -> 14-15

03 -> 17-18

05 -> 20-21

07, 10 -> 23-24

My requrement is if the variable name is in 01 level then it will extract the level information as copybook name. variable name.
If it is in 03 level then it will extract the level information as copybook name.Level 01 level variable name. 03 level varIABLE.

Code:

  01 UXXX                     
       03 GENXXXX,  /* NOT RESET AT EACH MESSAGE */           
          05 ORIXXXXXX            CHAR(32),                     
          05 ENVXXXX,              CHAR(32),   
             10 GLOXXX              CHAR(32),   
          05 STRATXXXX,   
             07 CSS_XXXXX         CHAR(1),
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Oct 06, 2008 12:59 pm
Reply with quote

Hello and welcome to the forums,

To get useful replies, i believe you need to do a better job of describing what you want to do.

Quote:
The following levels are written in line number:
What does this quote and the list of "line numbers" represent?

Quote:
01 UXXX
03 GENXXXX, /* NOT RESET AT EACH MESSAGE */
05 ORIXXXXXX CHAR(32),
05 ENVXXXX, CHAR(32),
10 GLOXXX CHAR(32),
05 STRATXXXX,
07 CSS_XXXXX CHAR(1),
Is this input or output?

Please show some input and the output you want from that input. Use the "Code" tag to preserve alignment. Do not try to post screen captures but rather use copy/paste. Use Preview to see how your post will appear to the forum (rather than the wat it appears n the reply editor.
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Tue Oct 07, 2008 1:12 am
Reply with quote

Satish K Kumar,

The following DFSORT JCL will give you the desired results

Code:

//STEP0100 EXEC PGM=ICEMAN                                         
//SYSOUT   DD SYSOUT=*                                             
//SORTIN   DD *                                                   
             01 UXXX                                               
                03 GENXXXX,  /* NOT RESET AT EACH MESSAGE */       
                   05 ORIXXXXXX            CHAR(32),               
                   05 ENVXXXX,              CHAR(32),             
                      10 GLOXXX              CHAR(32),             
                   05 STRATXXXX,                                   
                      07 CSS_XXXXX         CHAR(1),               
//SORTOUT  DD SYSOUT=*                                             
//SYSIN    DD *                                                   
  INCLUDE COND=(14,2,ZD,EQ,1,OR,                                   
                17,2,ZD,EQ,3,OR,                                   
                20,2,ZD,EQ,5,OR,                                   
                23,2,ZD,EQ,7,OR,                                   
                23,2,ZD,EQ,10)                                     
                                                                   
  INREC IFTHEN=(WHEN=(14,2,ZD,EQ,1),BUILD=(16,64)),               
    IFTHEN=(WHEN=(17,2,ZD,EQ,3),BUILD=(19,61)),                     
    IFTHEN=(WHEN=(20,2,ZD,EQ,5),BUILD=(22,58)),                     
    IFTHEN=(WHEN=(23,2,ZD,GE,7),BUILD=(25,55))                       
                                                                   
  SORT FIELDS=COPY                                                 
/*                                                                 


The output from this job is

Code:

 UXXX                                       
 GENXXXX,  /* NOT RESET AT EACH MESSAGE */   
 ORIXXXXXX            CHAR(32),             
 ENVXXXX,              CHAR(32),             
 GLOXXX              CHAR(32),               
 STRATXXXX,                                 
 CSS_XXXXX         CHAR(1),                 


If you just need the variable names then add the OUTREC statement with parse as shown below.

Code:

//STEP0100 EXEC PGM=ICEMAN                                         
//SYSOUT   DD SYSOUT=*                                             
//SORTIN   DD *                                                   
             01 UXXX                                               
                03 GENXXXX,  /* NOT RESET AT EACH MESSAGE */       
                   05 ORIXXXXXX            CHAR(32),               
                   05 ENVXXXX,              CHAR(32),             
                      10 GLOXXX              CHAR(32),             
                   05 STRATXXXX,                                   
                      07 CSS_XXXXX         CHAR(1),               
//SORTOUT  DD SYSOUT=*                                             
//SYSIN    DD *                                                   
  INCLUDE COND=(14,2,ZD,EQ,1,OR,                                   
                17,2,ZD,EQ,3,OR,                                   
                20,2,ZD,EQ,5,OR,                                   
                23,2,ZD,EQ,7,OR,                                   
                23,2,ZD,EQ,10)                                     
                                                                   
  INREC IFTHEN=(WHEN=(14,2,ZD,EQ,1),BUILD=(16,64)),               
    IFTHEN=(WHEN=(17,2,ZD,EQ,3),BUILD=(19,61)),                     
    IFTHEN=(WHEN=(20,2,ZD,EQ,5),BUILD=(22,58)),                     
    IFTHEN=(WHEN=(23,2,ZD,GE,7),BUILD=(25,55))                       
                                                                   
  SORT FIELDS=COPY                                                 
                                                                   
  OUTREC PARSE(%00=(ABSPOS=2,ENDBEFR=C' ',ENDBEFR=C',',FIXLEN=80)),
    BUILD=(%00)                                                     
/*                                                                 


This will produce

Code:

UXXX       
GENXXXX   
ORIXXXXXX 
ENVXXXX   
GLOXXX     
STRATXXXX 
CSS_XXXXX 
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 Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts DFsort help with SUM() DFSORT/ICETOOL 12
Search our Forums:

Back to Top