Page 1 of 1

FSUM7332 syntax error: got (, expecting Newline

Posted: Sat Oct 31, 2015 3:56 am
by demecarv
I created a very simple shell script with only one line aimed to move a folder. Such shell named test2.sh was created by touch command and after this I gave the permission via chmod 777. I tried to run test2.sh by triggering the JCL JOB pasted below but I got ABENDED S000 U4095 imediately after I runned the JOB and
FSUM7332 in STDERR output. Do I have to add a second line in my shell? If so, what is the purpose and what should I enter to close my shell script?

Code: Select all

test2.sh
000001, mv -r /usr/MyCompany/FROM /usr/MyCompany/TO

Code: Select all

JCL JOB
000001,//E0XXXXXR JOB (XXXXX,TS,4963),MySURNAME,NOTIFY=E0XXXXX,
000002,// CLASS=A,MSGCLASS=X,MSGLEVEL=(1,1),REGION=2047M
000003,/*JOBPARM SYSAFF=CPUE
000004,//BACKUP   EXEC PGM=IKJEFT01,DYNAMNBR=250,REGION=0M
000005,//SYSTSPRT DD SYSOUT=*
000006,//STDERR   DD SYSOUT=*
000007,//SYSTSIN DD   *
000008, BPXBATCH SH  +
000009, /usr/MyCompany/test2.sh
000010,//BACKUPA  EXEC PGM=MCIABEND,COND=(0,EQ,BACKUP)

Code: Select all

The error after I submitted the JCL above and hit F3
ABENDED S000 U4095

Code: Select all

The error showed in STDERR
DDNAME  StepName
STDERR   BACKUP
/usr/MyCompany/test2.sh 1: FSUM7332 syntax error: got (, expecting Newline

Re: FSUM7332 syntax error: got (, expecting Newline

Posted: Sat Oct 31, 2015 5:20 am
by Robert Sample
Looking at what you posted, the error message indicates you have a left parenthesis somewhere after the /TO in the first line of the shell. This is what needs to be fixed -- adding a second (or third or fourth or ...) line to your shell script isn't likely to help and could worsen things. Can you do a cat /usr/MyCompany/test2.sh and see what Unix thinks is in the file? You could use this JCL:

Code: Select all

//E0XXXXXR JOB (XXXXX,TS,4963),MySURNAME,NOTIFY=E0XXXXX,
// CLASS=A,MSGCLASS=X,MSGLEVEL=(1,1),REGION=2047M
/*JOBPARM SYSAFF=CPUE
//BACKUP   EXEC PGM=IKJEFT01,DYNAMNBR=250,REGION=0M
//SYSTSPRT DD SYSOUT=*
//STDERR   DD SYSOUT=*
//STDOUT  DD  SYSOUT=*
//SYSTSIN DD   *
  BPXBATCH cat /usr/MyCompany/test2.sh

Re: FSUM7332 syntax error: got (, expecting Newline

Posted: Wed Nov 04, 2015 1:40 am
by demecarv
I have no idea what I have done wrong. By the way, I created again a file via touch command and it worked. Kindly, see the attachament.

Re: FSUM7332 syntax error: got (, expecting Newline

Posted: Wed Nov 04, 2015 2:54 am
by Robert Sample
test2.sh looks like it might be ASCII (or at least some other code page) instead of EBCDIC.

Re: FSUM7332 syntax error: got (, expecting Newline

Posted: Wed Nov 04, 2015 3:02 am
by demecarv
Robert, is there a command to show me the file format (e.g. ASCII, EBCDIC and so on)?

Re: FSUM7332 syntax error: got (, expecting Newline

Posted: Wed Nov 04, 2015 5:04 am
by Robert Sample
I am not aware of any Unix System Services command that can determine the code set of a file. IBM supplies a wide variety with z/OS (see the XL C/C++ Programming Guide manual for a list of them). The most common ones are IBM-1047 and IBM-037 for EBCDIC and ISO8859-1 for ASCII. Unix System Services command iconv can convert a file from one code set to another but the translation process is pretty much translation table driven (that is, you provide the wrong source code set name and the wrong translation table will be used leading to more unreadable characters). You might try using iconv on your test2.sh to see if you get anything readable out in test2.ebcdic.sh:

Code: Select all

iconv -f ISO8859-1 -t IBM-1047 test2.sh > test2.ebcdic.sh 
The iconv default is to write the output to STDOUT, hence the redirect to test2.ebcdic.sh so the results can be viewed.