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
 

 

Reformatting of O/P file based on I/P value

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

New User


Joined: 16 Sep 2008
Posts: 72
Location: Bangalore

PostPosted: Tue Aug 10, 2010 11:09 pm    Post subject: Reformatting of O/P file based on I/P value
Reply with quote

I have an I/P file like following :

1CNCLABC123
2DCHGBCD456
3CNCLABC456
4DCHGBCD123

Layout :
1st byte = Sequence no
2-5 byte = Category
6-8 byte = Code1
9-11 byte = Code2

Requirement:
O/P file should contain only Category and Code, total 7 bytes in length.
If category = 'CNCL' ------> then code = Code1 (6-8 byte)
If Category = 'DCHG' -----> then code = Code2 (9-11 byte).

Please help me to do this one using SORT utility.
Back to top
View user's profile Send private message

Skolusu

Senior Member


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

PostPosted: Tue Aug 10, 2010 11:14 pm    Post subject: Reply to: Reformatting of O/P file based on I/P value
Reply with quote

Debasis Misra,

Code:

//STEP0100 EXEC PGM=SORT                           
//SYSOUT   DD SYSOUT=*                             
//SORTIN   DD *                                   
1CNCLABC123                                       
2DCHGBCD456                                       
3CNCLABC456                                       
4DCHGBCD123                                       
//SORTOUT  DD SYSOUT=*                             
//SYSIN    DD *
  INCLUDE COND=(2,4,SS,EQ,C'CNCL,DCHG')                                     
  SORT FIELDS=COPY                                 
  INREC IFOUTLEN=7,                               
  IFTHEN=(WHEN=(2,4,CH,EQ,C'CNCL'),BUILD=(2,7)),   
  IFTHEN=(WHEN=(2,4,CH,EQ,C'DCHG'),BUILD=(2,4,9,3))
//*                                               
Back to top
View user's profile Send private message
Debasis Misra
Warnings : 1

New User


Joined: 16 Sep 2008
Posts: 72
Location: Bangalore

PostPosted: Tue Aug 10, 2010 11:24 pm    Post subject:
Reply with quote

Thanks a lot!, its working, I have tried now.
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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am
No new posts Group Data based on a key Arun Raj DFSORT/ICETOOL 7 Thu Apr 27, 2017 11:29 pm


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