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
 

 

Can you write 2 recs on SORTOUT when SORTIN has only 1 rec

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

New User


Joined: 28 Sep 2005
Posts: 55
Location: USA

PostPosted: Thu Feb 23, 2017 12:07 am    Post subject: Can you write 2 recs on SORTOUT when SORTIN has only 1 rec
Reply with quote

I am trying to create a SYMNAMES file for a following step and it seems that this type of file needs a different line for each symbolic character.
I want my output to look like this. But I cannot figure out how to get the 2nd line written.
Is there anyone that could advise me? I have already been thru the DFSORT manual both online and paper form.

The SORTIN looks like this

Code:
****** ***************************** Top of Data ***********
=COLS> ----+----1----+----2----+----3----+----4----+----5---
000001        HOX                               A
000002                       


My SortCards look like this

Code:
//SYSIN     DD *
 SORT FIELDS=COPY
 INREC IFTHEN=(WHEN=(8,3,CH,EQ,C'3RD'),      <-- 1ST RCD
        OVERLAY=(1:C' JP1,''201''',11:33C' '),HIT=NEXT),
       IFTHEN=(WHEN=(8,3,CH,EQ,C'HOX'),
        OVERLAY=(1:C' JP1,''203''',11:33C' '),HIT=NEXT),
       IFTHEN=(WHEN=(42,1,CH,EQ,C'A'),       <-- 2ND RCD not writing
        OVERLAY=(1:C' JP2,''A''',11:33C' '),HIT=NEXT),
       IFTHEN=(WHEN=(42,1,CH,EQ,C'C'),
        OVERLAY=(1:C' JP2,''C''',11:33C' '))
 OUTFIL ENDREC=2


I want the output to look like this, but cant write the 2nd record:
Code:
****** ***************************** Top of Data *
000001  JP1,'203'
000002  JP2,'B'
****** **************************** Bottom of Data


Thank you for any help you can give.
Back to top
View user's profile Send private message

Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2278
Location: @my desk

PostPosted: Thu Feb 23, 2017 12:26 am    Post subject:
Reply with quote

You might want to use the OUTFIL with the '/' operator to write multiple lines.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Thu Feb 23, 2017 1:18 am    Post subject: Reply to: Can you write 2 recs on SORTOUT when SORTIN has only 1 rec
Reply with quote

Don't try to call your symbols JP1 and JP2, as those are in-built symbols with special meaning (to allow for up to 10 values from a PARM statement to DFSORT).

The SYMNAMES data set must contain fixed-length records of 80 bytes.

To generate two outputs from one input, you need to do as Arun has suggested, and use the slash operator, which is only present in BUILD in OUTFIL.
Code:

BUILD=(1,80,/,81,80)


That would output two records, from one 160-byte record.

Since you have data on the current record you want to test, you could OVERLAY the first output at 81:, the second output at 161: (with 240:X to pad with blanks) and then BUILD with 81,80,/,161,80.
Back to top
View user's profile Send private message
Sysaron

New User


Joined: 28 Sep 2005
Posts: 55
Location: USA

PostPosted: Thu Feb 23, 2017 4:25 am    Post subject:
Reply with quote

Thanks, but I have been searching the IBM Knowledge Center for almost 4 hours now looking for similar examples to what you have explained. I am a DFSORT newbie. Can you please point me to somewhere , that can point me to somewhere else, where I can try to find something similar to what I am trying to do please?
Thank you for your help.
Back to top
View user's profile Send private message
Sysaron

New User


Joined: 28 Sep 2005
Posts: 55
Location: USA

PostPosted: Thu Feb 23, 2017 4:45 am    Post subject:
Reply with quote

I tried this, but the output file is only 40 bytes, not 80 and the 2nd line still wont write.
Code:
SORT FIELDS=COPY
OUTFIL FILES=1,BUILD=(1,40,/,41,40),ENDREC=1
INREC IFTHEN=(WHEN=(8,3,CH,EQ,C'3RD'),      <-- 1ST RCD
       BUILD=(1:C' SS1,''201''',11:33C' '),HIT=NEXT),
      IFTHEN=(WHEN=(8,3,CH,EQ,C'HOX'),
       BUILD=(1:C' SS1,''203''',11:33C' '),HIT=NEXT),
      IFTHEN=(WHEN=(42,1,CH,EQ,C'A'),       <-- 2ND RCD NOT WRITING
       OVERLAY=(1:C' SS2,''A''',11:33C' '),HIT=NEXT),
      IFTHEN=(WHEN=(42,1,CH,EQ,C'C'),
       OVERLAY=(1:C' SS2,''C''',11:33C' '))
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2278
Location: @my desk

PostPosted: Thu Feb 23, 2017 7:22 pm    Post subject:
Reply with quote

Bill Woodger wrote:
The SYMNAMES data set must contain fixed-length records of 80 bytes
Sysaron - I think you missed this line in Bill's post above. If you intend to create a SYMNAMES data set, you would have to follow the rules.

You are not modifying your second symbol value, so you do not need any 'HIT=NEXT's. You might want to do something like this.
Code:
//SYSIN    DD *                             
  OPTION COPY                               
  INREC IFTHEN=(WHEN=(8,3,CH,EQ,C'3RD'),     
        OVERLAY=(8:C'201')),                 
        IFTHEN=(WHEN=(8,3,CH,EQ,C'HOX'),     
        OVERLAY=(8:C'203'))                 
  OUTFIL BUILD=(C'SS1,''',08,3,C'''',80:X,/,
                C'SS2,''',42,1,C'''')       

SORTOUT:
Code:
SS1,'203'
SS2,'A' 
Back to top
View user's profile Send private message
Sysaron

New User


Joined: 28 Sep 2005
Posts: 55
Location: USA

PostPosted: Thu Feb 23, 2017 8:58 pm    Post subject:
Reply with quote

Thank You Arun Raj!! I Really Appreciate this Help icon_biggrin.gif
I knew the SYMNAMES needed to be 80 bytes, but I had No Clue how to accomplish that, based on the IBM manuals and examples that I was looking at. Everything I tried failed the test. Thank You Again So Much!
~Sysaron
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 Need to write record of PS File in ex... Chandan1993 JCL & VSAM 1 Wed Jun 07, 2017 1:35 am
No new posts Write R1 and R2 to OP1 and R1 to OP2 bhaskar_kanteti DFSORT/ICETOOL 10 Fri Mar 03, 2017 11:18 am
No new posts For each given key value, how to keep... Div Grad DFSORT/ICETOOL 7 Fri Nov 11, 2016 11:38 pm
No new posts Error IEC161I 052(009,XXXRS00)-084 wh... amitc23 JCL & VSAM 10 Wed Oct 12, 2016 5:00 pm
No new posts Using 'parm' to vary SORTOUT record v... Sysaron DFSORT/ICETOOL 13 Wed Sep 07, 2016 9:24 pm


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