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
 

 

copying data without knowing location

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

New User


Joined: 13 Jul 2016
Posts: 18
Location: India

PostPosted: Thu Jul 20, 2017 1:03 pm    Post subject: copying data without knowing location
Reply with quote

Hi Team,

My input PS file looks like as below:-
03,0000000,,030,0,,,040,1110,,,060,0,,/
03,6000550,,030,1125414,,,040,9990,,,060,1125414,,/
03,550000,,030,0,,,040,8880,,,060,0,,/
03,7676767672,,030,0,,,040,7770,,,060,0,,/
88,072,0,,,074,0,,,100,0,0,,400,0,0,/

I need copy only bold fields into a PS file. Any pointer or any help.

Regards
Arun
Back to top
View user's profile Send private message

mistah kurtz

Active User


Joined: 28 Jan 2012
Posts: 287
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Thu Jul 20, 2017 1:30 pm    Post subject:
Reply with quote

If you have DFSORT or Syncsort, you can use its PARSE feature to get the desired output. You will find many examples in this forum.
Back to top
View user's profile Send private message
arunsoods

New User


Joined: 13 Jul 2016
Posts: 18
Location: India

PostPosted: Thu Jul 20, 2017 4:33 pm    Post subject:
Reply with quote

Thanks for the quick response.

I have prepared a sort card given below:-

Code:
SORT FIELDS=COPY                                     
INCLUDE COND=(01,2,CH,EQ,C'03',OR,01,2,CH,EQ,C'01')   
INREC  PARSE=(%01=(ENDBEFR=C'03,',FIXLEN=05),         
              %02=(ENDBEFR=C',,030,',FIXLEN=20),     
              %03=(ENDBEFR=C',,,040,',FIXLEN=15),     
              %04=(ENDBEFR=C',,,060,',FIXLEN=15),     
              %05=(ENDBEFR=C',,/',FIXLEN=15),         
              %06=(STARTAFT=C',AMERI005,',FIXLEN=06)),
       BUILD=(%02,%03,%04,%05,%06)     


My input data is :-
Code:
01,121000248,AMERI005,170712,2200,01,080,,2/ 
03,0000000,,030,0,,,040,1110,,,060,0,,/
03,6000550,,030,1125414,,,040,9990,,,060,1125414,,/
03,550000,,030,0,,,040,8880,,,060,0,,/
03,7676767672,,030,0,,,040,7770,,,060,0,,/


My expected output
Code:
0          0       1110 0       170712
6000550    1125414 9990 1125414 170712
550000     0       8880 0       170712
7676767672 0       7770 0       170712

I am getting the correct output but last date field is not populating. Pardon me output is not displaying in correct table format.

Code'd
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Thu Jul 20, 2017 7:46 pm    Post subject:
Reply with quote

Arun,

Use the code button to preserve data/code alignment.

From the data it looks like you want to propagate the date from the '01' record to all other '03' output records. Is that what you're trying to do?
How many '01' records will you have in input?
You might want to consider parsing based on the field number instead of field values (unless you're sure about it).

The idea should be to parse the variable fields to bring them to fixed positions, including the record type (01,03 etc). Then propagate the date in the first record to all the other records (use WHEN=GROUP and BEGIN when record type=01).
Back to top
View user's profile Send private message
arunsoods

New User


Joined: 13 Jul 2016
Posts: 18
Location: India

PostPosted: Thu Jul 20, 2017 9:13 pm    Post subject:
Reply with quote

Yes Arun my requirement is same as you understood.

There will be only one '01' type of record from which we have to fetch date field and put it with each '03' type record which I am parsing.

Parsing is working fine just putting the date fetched from '01' type is not concatating with each record.

Hope you understood
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Thu Jul 20, 2017 9:46 pm    Post subject:
Reply with quote

Quote:
Parsing is working fine just putting the date fetched from '01' type is not concatating with each record
Arun,

Parsing does not copy field data between records. It does not work similar to a symbol substitution. Once you have successfully parsed the data fields you want, then use a 'WHEN=GROUP...PUSH' to propagate the date field from the '01' record to your '03' records. Good luck.
Back to top
View user's profile Send private message
magesh23586

Active User


Joined: 06 Jul 2009
Posts: 170
Location: Chennai

PostPosted: Fri Jul 21, 2017 5:50 am    Post subject: Reply to: copying data without knowing location
Reply with quote

here is the snippest code.
Code:

//SYSIN    DD *                                                     
  OPTION COPY                                                 
  INREC IFTHEN=(WHEN=INIT,                                         
         PARSE=(%00=(ENDBEFR=C',',FIXLEN=05),                       
                %01=(ENDBEFR=C',',FIXLEN=20),                       
                %=(ENDBEFR=C',',FIXLEN=15),                         
                %02=(ENDBEFR=C',',FIXLEN=15),                       
                %=(ENDBEFR=C',',FIXLEN=15),                         
                %=(ENDBEFR=C',',FIXLEN=15),                         
                %=(ENDBEFR=C',',FIXLEN=15),                         
                %=(ENDBEFR=C',',FIXLEN=15),                         
                %03=(ENDBEFR=C',',FIXLEN=15),                       
                %=(ENDBEFR=C',',FIXLEN=15),                         
                %=(ENDBEFR=C',',FIXLEN=20),                         
                %=(ENDBEFR=C',',FIXLEN=20),                         
                %04=(ENDBEFR=C',',FIXLEN=20)),                     
         BUILD=(%00,%01,%03,%04,%02)),                             
        IFTHEN=(WHEN=GROUP,BEGIN=(1,2,CH,EQ,C'01'),PUSH=(61:61,6)) 
  OUTFIL INCLUDE=(1,2,CH,NE,C'01'),BUILD=(6,70)                     


You may need to adjust positions accordingly, also you may need to have EDIT=(IIIIIIIIIIIIT).. to suppress zeros if required.
Back to top
View user's profile Send private message
arunsoods

New User


Joined: 13 Jul 2016
Posts: 18
Location: India

PostPosted: Thu Jul 27, 2017 4:43 pm    Post subject:
Reply with quote

Hi magesh23586,

Your code snippet is not throwing the correct output can you please check. I was looking for only 03 level data and it is picking all records of the file. I have not mentioned other levels in the above input data example. Can you please help me to modify your code to data only from 03 level records:-

Code:
01,121111111,AMERI005,170712,2200,01,080,,2/     
02,AMERI005,091000019,1,170712,,,/               
03,121112111,,030,0,,,040,0,,,060,0,,/           
88,072,0,,,074,0,,,100,0,0,,400,0,0,/             
49,0,3/                                           
03,121121212,,030,323241,,,040,0,,,060,323241,,/
88,072,0,,,074,0,,,100,323241,1,,400,0,0,/       
49,969723,3/                                     
03,121212122,,030,133483,,,040,0,,,060,133483,,/
88,072,0,,,074,0,,,100,133483,1,,400,0,0,/       
49,400449,3/                                     
03,121212121,,030,403254,,,040,0,,,060,403254,,/
88,072,0,,,074,0,,,100,403254,1,,400,0,0,/       


For above mentioned input data I need below data as output:-

Code:
121112111   0        0        0   170712
121121212   323241   0   323241   170712
121212122   133483   0   133483   170712
121212121   403254   0   403254   170712


Hi Arun,

I am not able to find any good manual for the same can you please if possible provide any link to manual for the same.

Regards
Arun Sood
Back to top
View user's profile Send private message
arunsoods

New User


Joined: 13 Jul 2016
Posts: 18
Location: India

PostPosted: Thu Jul 27, 2017 5:15 pm    Post subject:
Reply with quote

Hi magesh23586,

Thanks no Need to reply again My code ran fine and throwing expected output.

Thanks Arun, for the help.

Regards
Arun Sood
Back to top
View user's profile Send private message
sergeyken

Active User


Joined: 29 Apr 2008
Posts: 128
Location: Maryland

PostPosted: Thu Jul 27, 2017 11:43 pm    Post subject:
Reply with quote

You must return starting position in PARSE %06 to the beginning of record:
Code:
%06=(ABSPOS=1,  - to restart parsing from the beginning
     STARTAFT=C',AMERI005,',
     ENDBEFR=C',',          - to handle empty or short parm, by a chance
     FIXLEN=06)),
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1846
Location: UK

PostPosted: Fri Jul 28, 2017 1:33 am    Post subject:
Reply with quote

I doubt if anything was "thrown" - in these particular instances you should have used "giving" which has a completely different meaning. (Nothing is "thrown" on a mainframe.)
Back to top
View user's profile Send private message
magesh23586

Active User


Joined: 06 Jul 2009
Posts: 170
Location: Chennai

PostPosted: Fri Jul 28, 2017 2:10 am    Post subject:
Reply with quote

Nic Clouston wrote:
I doubt if anything was "thrown" - in these particular instances you should have used "giving" which has a completely different meaning. (Nothing is "thrown" on a mainframe.)


Well Said..

icon_axe.gif
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Fri Jul 28, 2017 6:24 pm    Post subject:
Reply with quote

arunsoods wrote:
Hi magesh23586,

Thanks no Need to reply again My code ran fine and throwing expected output.

Thanks Arun, for the help.

Regards
Arun Sood
Arun,

Glad you figured it out. Thanks for letting know.
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 Unable to copy data from spool in a d... srikant314 JCL & VSAM 8 Fri Jul 28, 2017 9:10 pm
No new posts Paasing symbolic parameter to instrea... Robert Sample JCL & VSAM 2 Thu Jul 27, 2017 1:22 pm
No new posts Passing data from REXX to C programme... chong.zhou CLIST & REXX 3 Wed Jul 26, 2017 9:11 pm
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 19 Thu Jul 13, 2017 2:11 pm


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