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
 

 

SORT using a string from a separate file

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

New User


Joined: 31 Aug 2010
Posts: 20
Location: Edinburgh

PostPosted: Thu May 24, 2012 6:10 pm    Post subject: SORT using a string from a separate file
Reply with quote

I'm trying to pick up a date from a pds member, rearrange it and place in the header of my sortout file. I can't figure out how to tell sort to get the required string from a file ?

The PDS member is a FB 80 file with the the date in the following layout DD/MM/YYYY occupying the first 10 chars of the PDS member:
Example PDS: XXXX.YYYY.ZZZZ(TODAY)
Code:
24/05/2012

My SORTIN file is a FB 60 file that requires the date from the PDS to be inserted at col 20 in the format YYYYMMDD, the rest of the header should remain unchanged:
The rest of the SORTIN detail and trailer recs should be copied unchanged

Example input:
Code:
0XXXXXXXXXXXXXXXXXX20120401YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
1Record001
1Record002
1Record003
1Record004
1Record005
9Trailer

Desired output (only the header date has changed):
Code:
0XXXXXXXXXXXXXXXXXX20120524YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
1Record001
1Record002
1Record003
1Record004
1Record005
9Trailer


Many thanks.
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu May 24, 2012 6:21 pm    Post subject:
Reply with quote

one way would be:

step one:
extract date from pds and create a sysname.

step two:
use the sysname to overlay the file header.

there are various examples in the dfsort forum.

sorry, i am not into searching for you.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7306

PostPosted: Thu May 24, 2012 6:34 pm    Post subject: Reply to: SORT using a string from a separate file
Reply with quote

Have a look here for that which dbz has suggested.
Back to top
View user's profile Send private message
Yvonne1980

New User


Joined: 31 Aug 2010
Posts: 20
Location: Edinburgh

PostPosted: Thu May 24, 2012 7:07 pm    Post subject:
Reply with quote

SYMBOLS and SYMNAMES .... smashing !!!
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Thu May 24, 2012 8:50 pm    Post subject: Reply to: SORT using a string from a separate file
Reply with quote

Yvonne1980,

Assuming that your header record begins with a zero and is the only header then you can use the following joinkeys job

Code:

//STEP0100 EXEC PGM=SORT                                             
//SYSOUT   DD SYSOUT=*                                               
//INA      DD *                                                       
0XXXXXXXXXXXXXXXXXX20120401YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY         
1RECORD001                                                           
1RECORD002                                                           
1RECORD003                                                           
1RECORD004                                                           
1RECORD005                                                           
9TRAILER                                                             
//INB      DD *                                                       
----+----1----+----2----+----3----+----4----+----5----+----6----+----7
24/05/2012                                                           
//SORTOUT  DD SYSOUT=*                                               
//SYSIN    DD *                                                       
  OPTION COPY                                                         
  JOINKEYS F1=INA,FIELDS=(1,1,A),SORTED,NOSEQCK                       
  JOINKEYS F2=INB,FIELDS=(1,1,A),SORTED,NOSEQCK                       
  JOIN UNPAIRED                                                       
  REFORMAT FIELDS=(F1:1,60,?,F2:2,8)                                 
  INREC IFOUTLEN=60,IFTHEN=(WHEN=(61,1,CH,EQ,C'B'),OVERLAY=(20:62,8))
//*
//JNF2CNTL DD *                                                       
  INREC BUILD=(C'0',7,4,4,2,1,2)                                     
//*
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 Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm
No new posts Innovations in Your Mainframe Sort Arun Raj PC Guides & IT News 4 Wed Mar 15, 2017 10:38 pm
No new posts Updating a VSAM file with DISP=OLD sheersh JCL & VSAM 8 Tue Mar 14, 2017 6:14 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm


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